Optimal. Leaf size=194 \[ \frac {8 (3 A+7 i B) c^5 x}{a^2}+\frac {8 (3 i A-7 B) c^5 \log (\cos (e+f x))}{a^2 f}-\frac {8 (i A-B) c^5}{a^2 f (i-\tan (e+f x))^2}+\frac {16 (2 A+3 i B) c^5}{a^2 f (i-\tan (e+f x))}-\frac {(7 A+24 i B) c^5 \tan (e+f x)}{a^2 f}+\frac {(i A-7 B) c^5 \tan ^2(e+f x)}{2 a^2 f}+\frac {i B c^5 \tan ^3(e+f x)}{3 a^2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 194, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {c^5 (-7 B+i A) \tan ^2(e+f x)}{2 a^2 f}-\frac {c^5 (7 A+24 i B) \tan (e+f x)}{a^2 f}+\frac {16 c^5 (2 A+3 i B)}{a^2 f (-\tan (e+f x)+i)}-\frac {8 c^5 (-B+i A)}{a^2 f (-\tan (e+f x)+i)^2}+\frac {8 c^5 (-7 B+3 i A) \log (\cos (e+f x))}{a^2 f}+\frac {8 c^5 x (3 A+7 i B)}{a^2}+\frac {i B c^5 \tan ^3(e+f x)}{3 a^2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^5}{(a+i a \tan (e+f x))^2} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^4}{(a+i a x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (-\frac {(7 A+24 i B) c^4}{a^3}+\frac {i (A+7 i B) c^4 x}{a^3}+\frac {i B c^4 x^2}{a^3}+\frac {16 i (A+i B) c^4}{a^3 (-i+x)^3}+\frac {16 (2 A+3 i B) c^4}{a^3 (-i+x)^2}+\frac {8 (-3 i A+7 B) c^4}{a^3 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {8 (3 A+7 i B) c^5 x}{a^2}+\frac {8 (3 i A-7 B) c^5 \log (\cos (e+f x))}{a^2 f}-\frac {8 (i A-B) c^5}{a^2 f (i-\tan (e+f x))^2}+\frac {16 (2 A+3 i B) c^5}{a^2 f (i-\tan (e+f x))}-\frac {(7 A+24 i B) c^5 \tan (e+f x)}{a^2 f}+\frac {(i A-7 B) c^5 \tan ^2(e+f x)}{2 a^2 f}+\frac {i B c^5 \tan ^3(e+f x)}{3 a^2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(1357\) vs. \(2(194)=388\).
time = 7.53, size = 1357, normalized size = 6.99 \begin {gather*} \frac {4 (-3 i A+5 B) c^5 \cos (2 f x) \sec (e+f x) (\cos (f x)+i \sin (f x))^2 (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {\sec (e+f x) \left (3 A c^5 \cos (e)+7 i B c^5 \cos (e)+3 i A c^5 \sin (e)-7 B c^5 \sin (e)\right ) (8 \text {ArcTan}(\tan (f x)) \cos (e)+8 i \text {ArcTan}(\tan (f x)) \sin (e)) (\cos (f x)+i \sin (f x))^2 (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {\sec (e+f x) \left (3 A c^5 \cos (e)+7 i B c^5 \cos (e)+3 i A c^5 \sin (e)-7 B c^5 \sin (e)\right ) \left (4 i \cos (e) \log \left (\cos ^2(e+f x)\right )-4 \log \left (\cos ^2(e+f x)\right ) \sin (e)\right ) (\cos (f x)+i \sin (f x))^2 (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {\sec (e) \sec ^3(e+f x) (3 A \cos (e)+21 i B \cos (e)+2 B \sin (e)) \left (\frac {1}{6} i c^5 \cos (2 e)-\frac {1}{6} c^5 \sin (2 e)\right ) (\cos (f x)+i \sin (f x))^2 (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {(A+i B) \cos (4 f x) \sec (e+f x) \left (2 i c^5 \cos (2 e)+2 c^5 \sin (2 e)\right ) (\cos (f x)+i \sin (f x))^2 (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {(3 A+7 i B) \sec (e+f x) \left (8 c^5 f x \cos (2 e)+8 i c^5 f x \sin (2 e)\right ) (\cos (f x)+i \sin (f x))^2 (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}-\frac {4 (3 A+5 i B) c^5 \sec (e+f x) (\cos (f x)+i \sin (f x))^2 \sin (2 f x) (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {(A+i B) \sec (e+f x) \left (2 c^5 \cos (2 e)-2 i c^5 \sin (2 e)\right ) (\cos (f x)+i \sin (f x))^2 \sin (4 f x) (A+B \tan (e+f x))}{f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {\sec (e) \sec ^4(e+f x) (\cos (f x)+i \sin (f x))^2 \left (-\frac {1}{2} B c^5 \cos (2 e-f x)+\frac {1}{2} B c^5 \cos (2 e+f x)-\frac {1}{2} i B c^5 \sin (2 e-f x)+\frac {1}{2} i B c^5 \sin (2 e+f x)\right ) (A+B \tan (e+f x))}{3 f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {\sec (e) \sec ^2(e+f x) (\cos (f x)+i \sin (f x))^2 \left (-\frac {21}{2} i A c^5 \cos (2 e-f x)+\frac {73}{2} B c^5 \cos (2 e-f x)+\frac {21}{2} i A c^5 \cos (2 e+f x)-\frac {73}{2} B c^5 \cos (2 e+f x)+\frac {21}{2} A c^5 \sin (2 e-f x)+\frac {73}{2} i B c^5 \sin (2 e-f x)-\frac {21}{2} A c^5 \sin (2 e+f x)-\frac {73}{2} i B c^5 \sin (2 e+f x)\right ) (A+B \tan (e+f x))}{3 f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2}+\frac {x \sec (e+f x) (\cos (f x)+i \sin (f x))^2 \left (-24 A c^5-56 i B c^5-24 i A c^5 \tan (e)+56 B c^5 \tan (e)+(-3 i A+7 B) \left (8 c^5 \cos (2 e)+8 i c^5 \sin (2 e)\right ) \tan (e)\right ) (A+B \tan (e+f x))}{(A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^2} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.31, size = 127, normalized size = 0.65
method | result | size |
derivativedivides | \(\frac {c^{5} \left (\frac {i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {i A \left (\tan ^{2}\left (f x +e \right )\right )}{2}-24 i B \tan \left (f x +e \right )-\frac {7 B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-7 A \tan \left (f x +e \right )-\frac {48 i B +32 A}{-i+\tan \left (f x +e \right )}-\frac {16 i A -16 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}+\left (-24 i A +56 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )\right )}{f \,a^{2}}\) | \(127\) |
default | \(\frac {c^{5} \left (\frac {i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {i A \left (\tan ^{2}\left (f x +e \right )\right )}{2}-24 i B \tan \left (f x +e \right )-\frac {7 B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-7 A \tan \left (f x +e \right )-\frac {48 i B +32 A}{-i+\tan \left (f x +e \right )}-\frac {16 i A -16 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}+\left (-24 i A +56 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )\right )}{f \,a^{2}}\) | \(127\) |
risch | \(\frac {20 c^{5} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a^{2} f}-\frac {12 i c^{5} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a^{2} f}-\frac {2 c^{5} {\mathrm e}^{-4 i \left (f x +e \right )} B}{a^{2} f}+\frac {2 i c^{5} {\mathrm e}^{-4 i \left (f x +e \right )} A}{a^{2} f}+\frac {112 i c^{5} B x}{a^{2}}+\frac {48 c^{5} A x}{a^{2}}+\frac {112 i c^{5} B e}{f \,a^{2}}+\frac {48 c^{5} A e}{f \,a^{2}}+\frac {2 c^{5} \left (-18 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+54 B \,{\mathrm e}^{4 i \left (f x +e \right )}-39 i A \,{\mathrm e}^{2 i \left (f x +e \right )}+123 B \,{\mathrm e}^{2 i \left (f x +e \right )}-21 i A +73 B \right )}{3 f \,a^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {56 c^{5} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f \,a^{2}}+\frac {24 i c^{5} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f \,a^{2}}\) | \(267\) |
norman | \(\frac {\frac {-25 i c^{5} A +47 B \,c^{5}}{a f}+\frac {8 \left (7 i c^{5} B +3 A \,c^{5}\right ) x}{a}-\frac {\left (-i c^{5} A +7 B \,c^{5}\right ) \left (\tan ^{6}\left (f x +e \right )\right )}{2 a f}-\frac {7 \left (10 i c^{5} B +3 A \,c^{5}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{3 a f}+\frac {\left (-83 i c^{5} A +133 B \,c^{5}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 a f}+\frac {16 \left (7 i c^{5} B +3 A \,c^{5}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{a}+\frac {8 \left (7 i c^{5} B +3 A \,c^{5}\right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{a}-\frac {\left (56 i c^{5} B +23 A \,c^{5}\right ) \tan \left (f x +e \right )}{a f}-\frac {\left (287 i c^{5} B +138 A \,c^{5}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}+\frac {i c^{5} B \left (\tan ^{7}\left (f x +e \right )\right )}{3 a f}}{a \left (1+\tan ^{2}\left (f x +e \right )\right )^{2}}+\frac {4 \left (-3 i c^{5} A +7 B \,c^{5}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{a^{2} f}\) | \(318\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.84, size = 343, normalized size = 1.77 \begin {gather*} \frac {2 \, {\left (24 \, {\left (3 \, A + 7 i \, B\right )} c^{5} f x e^{\left (10 i \, f x + 10 i \, e\right )} - 3 \, {\left (3 i \, A - 7 \, B\right )} c^{5} e^{\left (2 i \, f x + 2 i \, e\right )} - 3 \, {\left (-i \, A + B\right )} c^{5} + 12 \, {\left (6 \, {\left (3 \, A + 7 i \, B\right )} c^{5} f x - {\left (3 i \, A - 7 \, B\right )} c^{5}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 6 \, {\left (12 \, {\left (3 \, A + 7 i \, B\right )} c^{5} f x - 5 \, {\left (3 i \, A - 7 \, B\right )} c^{5}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, {\left (12 \, {\left (3 \, A + 7 i \, B\right )} c^{5} f x - 11 \, {\left (3 i \, A - 7 \, B\right )} c^{5}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} - 12 \, {\left ({\left (-3 i \, A + 7 \, B\right )} c^{5} e^{\left (10 i \, f x + 10 i \, e\right )} + 3 \, {\left (-3 i \, A + 7 \, B\right )} c^{5} e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, {\left (-3 i \, A + 7 \, B\right )} c^{5} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-3 i \, A + 7 \, B\right )} c^{5} e^{\left (4 i \, f x + 4 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \, {\left (a^{2} f e^{\left (10 i \, f x + 10 i \, e\right )} + 3 \, a^{2} f e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, a^{2} f e^{\left (6 i \, f x + 6 i \, e\right )} + a^{2} f e^{\left (4 i \, f x + 4 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.82, size = 445, normalized size = 2.29 \begin {gather*} \frac {- 42 i A c^{5} + 146 B c^{5} + \left (- 78 i A c^{5} e^{2 i e} + 246 B c^{5} e^{2 i e}\right ) e^{2 i f x} + \left (- 36 i A c^{5} e^{4 i e} + 108 B c^{5} e^{4 i e}\right ) e^{4 i f x}}{3 a^{2} f e^{6 i e} e^{6 i f x} + 9 a^{2} f e^{4 i e} e^{4 i f x} + 9 a^{2} f e^{2 i e} e^{2 i f x} + 3 a^{2} f} + \begin {cases} \frac {\left (\left (2 i A a^{2} c^{5} f e^{2 i e} - 2 B a^{2} c^{5} f e^{2 i e}\right ) e^{- 4 i f x} + \left (- 12 i A a^{2} c^{5} f e^{4 i e} + 20 B a^{2} c^{5} f e^{4 i e}\right ) e^{- 2 i f x}\right ) e^{- 6 i e}}{a^{4} f^{2}} & \text {for}\: a^{4} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac {48 A c^{5} + 112 i B c^{5}}{a^{2}} + \frac {\left (48 A c^{5} e^{4 i e} - 24 A c^{5} e^{2 i e} + 8 A c^{5} + 112 i B c^{5} e^{4 i e} - 40 i B c^{5} e^{2 i e} + 8 i B c^{5}\right ) e^{- 4 i e}}{a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {8 i c^{5} \cdot \left (3 A + 7 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{2} f} + \frac {x \left (48 A c^{5} + 112 i B c^{5}\right )}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 517 vs. \(2 (172) = 344\).
time = 1.07, size = 517, normalized size = 2.66 \begin {gather*} \frac {2 \, {\left (\frac {12 \, {\left (3 i \, A c^{5} - 7 \, B c^{5}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{2}} - \frac {24 \, {\left (3 i \, A c^{5} - 7 \, B c^{5}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a^{2}} - \frac {12 \, {\left (-3 i \, A c^{5} + 7 \, B c^{5}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a^{2}} - \frac {66 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 154 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 21 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 72 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 201 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 483 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 42 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 148 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 201 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 483 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 21 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 72 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 66 i \, A c^{5} + 154 \, B c^{5}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{3} a^{2}} - \frac {2 \, {\left (-75 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 175 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 324 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 748 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 522 i \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1170 \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 324 \, A c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 748 i \, B c^{5} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 75 i \, A c^{5} + 175 \, B c^{5}\right )}}{a^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{4}}\right )}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.81, size = 282, normalized size = 1.45 \begin {gather*} -\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-\frac {56\,B\,c^5}{a^2}+\frac {A\,c^5\,24{}\mathrm {i}}{a^2}\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (-\frac {3\,B\,c^5}{2\,a^2}+\frac {c^5\,\left (A+B\,4{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a^2}\right )}{f}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {3\,c^5\,\left (A+B\,4{}\mathrm {i}\right )}{a^2}+\frac {B\,c^5\,6{}\mathrm {i}}{a^2}-\frac {c^5\,\left (-3\,B+A\,2{}\mathrm {i}\right )\,2{}\mathrm {i}}{a^2}\right )}{f}+\frac {-\frac {\left (-24\,B\,c^5+A\,c^5\,8{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a^2}+\frac {16\,A\,c^5+B\,c^5\,64{}\mathrm {i}}{2\,a^2}+\frac {\left (-56\,B\,c^5+A\,c^5\,24{}\mathrm {i}\right )\,3{}\mathrm {i}}{2\,a^2}+\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {\left (16\,A\,c^5+B\,c^5\,64{}\mathrm {i}\right )\,1{}\mathrm {i}}{a^2}-\frac {2\,\left (-56\,B\,c^5+A\,c^5\,24{}\mathrm {i}\right )}{a^2}\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}+2\,\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}+\frac {B\,c^5\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,a^2\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________